package main

import (
	"fmt"

	"github.com/go-redis/redis"
)

func main2() {
	redisClient()
}

func redisClient() {
	client := redis.NewClient(&redis.Options{
		Addr: "127.0.0.1:6379",
		DB:   0,
	})
	pubsub := client.Subscribe("channel")
	defer pubsub.Close()
	for msg := range pubsub.Channel() {
		fmt.Println(msg.Payload)
	}
}
